package phasebookws.clientsample;

import javax.xml.datatype.XMLGregorianCalendar;

import phasebookws.ESBWS;
import phasebookws.IFacade;
import phasebookws.InvalidAuthenticationException_Exception;
import phasebookws.LotteryGameObj;
import phasebookws.PhasebookToken;
import phasebookws.Userprofile;


public class Test {

	public static void main (String[] args) {
		
		ESBWS xxx = new ESBWS();
		
		PhasebookToken token = new PhasebookToken();
		token.setUserId(33);
		
		IFacade facadePort = xxx.getFacadePort();
		
		try {
			
			String email = facadePort.getEMailById(token);
			XMLGregorianCalendar lastLogin = facadePort.getLastLogin(token, email);
			System.out.println("Email: "+email+"\nLast Login: "+lastLogin);
			
			Userprofile profileById = facadePort.getProfileById(token);
			System.out.println("Locality: "+profileById.getLocality());

			LotteryGameObj activeLotteryDetails = facadePort.getActiveLotteryDetails(token);
			
			System.out.println("Game is on "+ activeLotteryDetails.getDate());
			
			facadePort.updateCity(token, "RANA");
			
		} catch (InvalidAuthenticationException_Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
